home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 7_10.lha / 7_10 / test2.h < prev    next >
C/C++ Source or Header  |  1993-08-08  |  436b  |  26 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. * based on cfront 2.0 release notes Spaces example */
  6. include <process.h>
  7.  
  8. lass Spaces : public process
  9.  
  10. char *s;
  11. ublic:
  12. Spaces(char *ns);
  13. long main();
  14. ;
  15.  
  16. paces::Spaces(char *ns) : ("spaces") { s = ns; }
  17.  
  18. ong Spaces::main()
  19.  
  20.    int i = 0;
  21.    while (*s)
  22. if (*s++ == ' ')
  23.     i++;
  24.    return i;
  25.  
  26.